{% extends "header.html" %}

{% block title %}
	Switches
{% endblock %}

{% block page_content %}
	<div class="page-header">
		<h3 class="h3">
			List of Switches connected :
		</h3>
	</div>
	<div class="table-responsive">
		<table class="table table-hover">
			{% for line_count in range(resp.__len__()) %}
			<tr>
				<td class="click-dropdown-field">
					<div class="header">
						<strong>
							<span class="device-number">
								Switch {{line_count + 1}} :
							</span>

							<span class="device-address">
								Datapath Address : {{resp[line_count].dpid}}
							</span>
						</strong>
					</div>

					<div class="content-switches">
						Remote IP Address : {{resp[line_count].remoteIp}}
						<br/>
						Port Number : {{resp[line_count].remotePort}}
					</div>
				</td>
			</tr>
			{% endfor %}
		</table>
	</div>
{% endblock %}

{% block scripts %}
	{{ super() }}
	<script type="text/javascript" src="{{url_for('static', filename='js/switches.js')}}"></script>
	<script type="text/javascript">
		setInterval(function(){
			$('.table-responsive').load(document.URL +  ' .table-responsive');
		}, 5000);
	</script>
{% endblock %}